import _regeneratorRuntime from "@babel/runtime/regenerator";
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
import request from 'utils/request';
/**
 * 登出
 */

export function logout(_x) {
  return _logout.apply(this, arguments);
}

function _logout() {
  _logout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(record) {
    var loginName, url;
    return _regeneratorRuntime.wrap(function _callee$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            loginName = record.loginName;
            url = '/admin/token';
            return _context.abrupt("return", request(url, {
              method: 'DELETE',
              body: [loginName]
            }));

          case 3:
          case "end":
            return _context.stop();
        }
      }
    }, _callee);
  }));
  return _logout.apply(this, arguments);
}